#!/usr/bin/env python

import time
from mxit import handles

class Account:
   gender = handles.Gender.FEMALE;
   private = handles.PrivateNumber.NO;
   name = '';
   birthdate = int(time.time());
   autologin = True;
   rememberPassword = True;
   lang = 'en';

   def __init__(self,alias,username,password,auth,autologin,lang):
      if alias == "":
         self.display = None;
      else:
         self.display = alias;

      self.username = username;
      self.password = password;
      self.auth = auth;
      self.autologin = autologin;
      self.lang = lang;
      
   @property
   def alias(self):
      if self.display is None:
         if self.name is not None:
            return self.name;
         else:
            return self.username;
      else:
         return self.display;

   def set_birthdate(self,birthdate):
      self.birthdate = time.strptime(birthdate,"%Y-%m-%d");